{{define "content"}}
<div class="pageheader notab">
	<h1 class="pagetitle">修改文章</h1>
</div><!--pageheader-->

<div id="contentwraapper" class="contentwrapper">
	<div id="tooltip" class="red"></div>
	<form method="POST" action="/admin/reading/publish" class="stdform">
		{{if .reading}}
		<input type="hidden" id="id" name="id" value="{{.reading.Id}}" />
		<div>
			<p>
				<label>编号ID</label>
				<span class="field txt">
					{{.reading.Id}}
				</span>
			</p>
		</div>
		{{end}}
		<div>
			<p>
				<label for="rtype">晨读类型</label>
				<span class="field">
					<select id="rtype" name="rtype" class="uniformselect">
							<option value="0"{{if .reading }}{{if eq .reading.Rtype 0}} selected{{end}}{{end}}>Go晨读</option>
							<option value="1"{{if .reading}}{{if eq .reading.Rtype 1}} selected{{end}}{{end}}>综合晨读</option>
					</select>
				</span>
			</p>
		</div>
		<div>
			<p>
				<label for="content">晨读内容</label>
				<span class="field">
					<textarea id="content" name="content" rows="12" class="required">{{if .reading}}{{.reading.Content}}{{end}}</textarea>
				</span>
			</p>
		</div>
		<div>
			<p>
				<label for="inner">本站文章ID</label>
				<span class="field">
					<input id="inner" type="text" name="inner" class="smallinput" value="{{if .reading}}{{.reading.Inner}}{{end}}" />&nbsp;0或空 表示非本站文章，需要提供 晨读文章链接
				</span>
			</p>
		</div>
		<div>
			<p>
				<label for="url">晨读文章链接</label>
				<span class="field">
					<input id="url" type="text" name="url" class="mediuminput {url:true}" value="{{if .reading}}{{.reading.Url}}{{end}}" />&nbsp;<a href="{{if .reading}}{{.reading.Url}}{{end}}" target="_blank" style="color:blue;">查看</a>
				</span>
			</p>
		</div>
		<div>
			<p>
				<label>相关阅读链接：</label>
				<span class="field">
					<textarea name="moreurls" rows="5">{{if .reading}}{{.reading.Moreurls}}{{end}}</textarea>&nbsp;跟晨读相关的其他文章链接，一行一个
				</span>
			</p>
		</div>
		<div>
			<p> 
				<label>&nbsp;</label>
				<input type="submit" class="submit radius2" value="提交" />
			</p>
		</div>
	</form>
	<img id="loaders" src="/static/img/loaders/loader7.gif" alt="" class="hide">
	<div id="toast"></div>
	<br/>
	<br/>
</div><!--contentwrapper-->
{{end}}

{{define "css"}}
<link href="/static/css/libs/jquery.cftoaster.1.0.1.css" media="screen" rel="stylesheet" type="text/css">
{{end}}

{{define "js"}}
<script src="https://cdn.bootcss.com/jquery-validate/1.17.0/jquery.validate.min.js"></script>
<script src="https://cdn.bootcss.com/jquery-validate/1.17.0/localization/messages_zh.min.js"></script>
<script type="text/javascript" src="/static/js/libs/jquery.metadata.js"></script>
<script type="text/javascript" src="/static/js/libs/jquery.cftoaster.1.0.1.min.js"></script>
<script	type="text/javascript" src="/static/js/admin/forms.js"></script>
{{end}}